<template>
  <div>
    <p v-for="i in paramslist" :key="i">
      <van-field v-if="i.type == 'input'" :label="i.lable"/>
      <select name="" id="" v-if="i.type == 'select'">
        <option :value="j.type" v-for="j in i.values" :key="j">{{j.name}}</option>
      </select>
      <van-uploader v-if="i.type == 'file'" />
      <el-date-picker
        v-if="i.type == 'datetime'"
        v-model="value1"
        type="datetimerange"
        range-separator="To"
        start-placeholder="开始时间"
        end-placeholder="结束时间"></el-date-picker>
    </p>
    <van-button @click="submit">提交</van-button>
  </div>
</template>

<script>
import myaxios from 'axios'
export default {
name: "qingjia",
  data(){
   return{
     wid:this.$route.query.id,
     workf:{},
     paramslist:{},
     value1:[],
     values:{},
     pic:'1.jpg'
   }
  },
  methods:{
    getwork(){
      myaxios({url:'http://127.0.0.1:5000/getworkf', method:'post', data:{'id':this.wid}})
      .then(res=>{
        console.log(res.data)
        this.workf = res.data.workf
        this.paramslist = JSON.parse(res.data.workf.params)
      })
    },
    submit(){
      console.log()
    }
  },
  mounted() {
    this.getwork()
  }
}
</script>

<style scoped>

</style>